
#include "nane/CodecSystem/Image/ImageCodecSystemImpl_.h"
#include "nane/CodecSystem/Image/ImageDecoderImpl_.h"

#include "nane/core/assert.h"

namespace nane
{

    ////////////////////////////////////////////////////////////////////////////////////////////////
    ImageCodecSystem::Implementation::Implementation()
        : SubSystem<IImageCodecSystem>::Implementation("IImageCodecSystem")
    {
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////
    ImageCodecSystem::Implementation::~Implementation()
    {
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////
    void ImageCodecSystem::Implementation::Release( ImageDecoder::Implementation* _imageDecoderImpl )
    {
        NANE_ASSERT_R( interface != NULL, "ImageCodecSystem must be initialized" );
        NANE_ASSERT_R( this == _imageDecoderImpl->creator, "ImageDecoder must be valid" );
        IImageDecoder* imageDecoderInterface = _imageDecoderImpl->interface;
        delete _imageDecoderImpl;
        interface->ReleaseDecoder(imageDecoderInterface);
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////
}   // namespace nane
